Skip to content

Conversation

@arthokal
Copy link
Collaborator

No description provided.

Nava kishore Manne added 4 commits August 13, 2025 09:36
Introduces optional support for specifying a custom CMA file path for
DMA buffer allocation. The following changes are made:

- Updated `dfx_cfg_init()` and `dfx_cfg_init_file()` to accept an optional
  `cma_file` parameter using variadic arguments (`va_list`), maintaining
  backward compatibility with existing calls.
- Modified `dfx_cfg_init_common()` and `dfx_package_load_dmabuf()` to
  accept and pass through the `cma_file` pointer.
- Refactored `open_device()` to try opening the provided `cma_file`, and
  fall back to default `/dev/dma_heap/*` paths if not provided.
- Extended `dma_buffer_info` struct to include `cma_file` as a member.
- Updated `export_dma_buffer()` to pass `cma_file` from `dma_data`.

These changes allow users to override the default DMA heap path during
runtime configuration, offering greater flexibility across different
platforms or reserved memory configurations.

Signed-off-by: Nava kishore Manne <nava.kishore.manne@amd.com>
…bdfx

The README has been updated to explain how you can optionally use a custom
CMA (Contiguous Memory Allocator) file in libdfx. By default, the library
uses standard DMA heap paths like /dev/dma_heap/reserved or
/dev/dma_heap/cma_reserved@800000000. If a custom CMA file path is provided
and fails to open, it will fall back to the default. The update includes
simple examples showing how to use this feature with dfx_cfg_init() and
dfx_cfg_init_file(). This option is useful for platforms with specific
DMA buffer setup needs.

Signed-off-by: Nava kishore Manne <nava.kishore.manne@amd.com>
- Introduce semantic versioning (MAJOR.MINOR.PATCH) for libdfx.
- Use VERSION and SOVERSION properties for shared library to set SONAME.
- Cleaned up target properties with modern `set_target_properties`.
- Added explicit install rules for headers, shared, and static libraries.
- Copy `libdfx.h` to build directory for IDE support.
- Ensure install of runtime targets into ${CMAKE_INSTALL_BINDIR}.

Signed-off-by: Nava kishore Manne <nava.kishore.manne@amd.com>
Updates open_device() to provide dynamic and reliable handling of
CMA heaps under /dev/dma_heap. It now scans for any cma_reserved@*
node and opens it only if the corresponding device tree node has
the linux,cma-default property, verified via the new helper function
is_cma_default_node(). This ensures that only valid, default CMA heaps
are used.

Signed-off-by: Nava kishore Manne <nava.kishore.manne@amd.com>
@arthokal arthokal merged commit e937e61 into master Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants